import { Input } from "antd";
import React, { useEffect, useState } from "react";
import style from "./xx-rangeInput.module.scss"
const XxRangeInput = ({ value, onChange }) => {
    const [values, setValues] = useState([]);



    const onChangeInput = (e, index) => {
        let res = [...values];
        res[index] = Number(e.target.value);
        setValues(res);
        onChange(res)
    }
    return (
        <div className={style.rangeInput}>
            <Input type="number" onChange={(e) => onChangeInput(e, 0)} />
            <span className="rangeInput-separator">至</span>
            <Input type="number" onChange={(e) => onChangeInput(e, 1)} />
        </div>
    )
}
export default XxRangeInput;